1. Technical Field
This application generally relates to data operations, and more particularly to techniques used in connection with processing a data operation.
2. Description of Related Art
Computer systems may include different resources used by one or more host processors. Resources and host processors in a computer system may be interconnected by one or more communication connections. These resources may include, for example, data storage devices such as those included in the data storage systems manufactured by EMC Corporation. These data storage systems may be coupled to one or more host processors and provide storage services to each host processor. Multiple data storage systems from one or more different vendors may be connected and may provide common data storage for one or more host processors in a computer system.
A host processor may perform a variety of data processing tasks and operations using the data storage system. For example, a host processor may perform basic system I/O operations in connection with data requests, such as data read and write operations.
Host processor systems may store and retrieve data using a storage device containing a plurality of host interface units, disk drives, and disk interface units. Such storage devices are provided, for example, by EMC Corporation of Hopkinton, Mass. and disclosed in U.S. Pat. No. 5,206,939 to Yanai et al., U.S. Pat. No. 5,778,394 to Galtzur et al., U.S. Pat. No. 5,845,147 to Vishlitzky et al., and U.S. Pat. No. 5,857,208 to Ofek. The host systems access the storage device through a plurality of channels provided therewith. Host systems provide data and access control information through the channels to the storage device and storage device provides data to the host systems also through the channels. The host systems do not address the disk drives of the storage device directly, but rather, access what appears to the host systems as a plurality of logical disk units. The logical disk units may or may not correspond to the actual disk drives. Allowing multiple host systems to access the single storage device unit allows the host systems to share data stored therein.
A write command may specify one or more blocks on a data storage device as a target location. In connection with a write command modifying multiple blocks, the write command may be executed so that a first block N affected by the write command is updated prior to the contents at block N+1 also modified by the write command.
In existing systems, two write commands may be issued by one or more hosts to a same target location of a data storage device. The data storage system may receive the foregoing two write commands and perform processing for both write commands at a same time. After both write commands are applied, the target location may contain one of two possible valid data results depending on which write command is applied first. Each of the valid data results is formed by applying one write command completely to the target location prior to applying the second write command in order to preserve the data integrity with respect to a single write command. In order to ensure that the target location contains one of the foregoing valid data results and rather than an invalid data result, processing may be performed.
When the target location of write command spans multiple blocks within a single track, that track may be locked when writing to the track. When the write command spans more than a single track, additional processing may be performed to ensure a valid data result in the target location.
One technique for preserving the integrity of the write command spanning more than a single track includes locking the entire device containing the target location. The foregoing ensures a valid data result but does not allow more than one write command to the device at a time which can be impractical and very undesirable. As an alternative, an embodiment may utilize a technique in which the lock on track N−1 is obtained prior to writing to track N−1. A track is written only after the lock is obtained. In order to write to the next track N, the lock on track N is also obtained while also holding the lock to track N−1. When writing to track N+1, the lock on the previous track N is retained and the lock on track N−1 surrendered. As such, when writing to track N+1, the lock of the previous track N is retained as well as retaining the lock on track N+1 so that at most two tracks are locked at a time when processing a write command. The foregoing preserves data validity for write commands spanning more than one track in which the write command does not skip tracks or blocks at the target location. In other words, when a target location of a write command has an associated range, all blocks within the range are written to in order of increasing address.
Existing systems, such as those operating in accordance with the SCSI standard, may also utilize a skip mask write command which uses a bit mask indicating which blocks or portions of the foregoing range of blocks are to be modified by the write command. The target of the write command may span an address range in which not all blocks or tracks included therein are modified.